package com.atguigu.spzx.manager.mapper;

import com.atguigu.spzx.manager.entity.Product;
import com.atguigu.spzx.manager.vo.product.ProductDetailsRespVo;
import com.atguigu.spzx.manager.vo.product.ProductQueryReqVo;
import com.atguigu.spzx.manager.vo.product.ProductQueryRespVo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

@Mapper
public interface ProductMapper extends BaseMapper<Product> {

    /**
     * 条件分页查询
     *
     * @param pageParam
     * @param reqVo
     * @return
     */
    Page<ProductQueryRespVo> getProductPageByQuery(@Param("pageParam") Page<Product> pageParam, @Param("vo") ProductQueryReqVo reqVo);


    /**
     * 根据id查询商品详情
     * @param id
     * @return
     */
    ProductDetailsRespVo getProductById(@Param("id") Long id);
}
